/*
brackets
Author: Nekrasov Ilya 111 group
*/

#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

#define q 102

int i,indic, len;
char next;

string str,k;

int S(string k)
{
    char next;

    next='0';

    if (k[i]=='(')
    {
        next=')';
    }

    if (k[i]=='{')
    {
        next='}';
    }

    if (k[i]=='[')
    {
        next=']';
    }

    if (next=='0')
    {
        indic=0;
    }

    i++;

    while ((k[i]!=next)and(i<len))
    {
        if (i == len)
        {
            indic=0;
        }

        S(str);
    }

    i++;

}


int main()
{
  FILE * pFile;
  pFile=fopen("tratata.txt", "r");


  ifstream myfile ("tratata.txt");
  if (myfile.is_open() && myfile.good())
  {
    getline (myfile,str);
    cout << str << endl;
    myfile.close();
  }



len=sizeof(str);

i=0;

 while (i<len)
    {
        S(str);
    }

if (indic==0)
  {
      printf("true");
  }
  else{printf("fe\alse");}


}